﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using JuCheap.Core.Interfaces;
using JuCheap.Core.Services.AppServices;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace JuCheap.Core.Web.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class SysApiController : Controller
    {

        private readonly IRepository _iRepository;
        public SysApiController(IRepository iRepository)
        {
            _iRepository = iRepository;
        }

        // GET: api/SysApi
        [HttpGet]
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // GET: api/SysApi/5
        [HttpGet]
        [Route("/api/SysApi/GetAllRecords")]
        public async Task<string> GetAllRecords(string type, string size, string date)
        {
            return await _iRepository.GetAllRecords(type, size, date);
        }


        //[HttpGet]
        //[Route("/api/SysApi/GetAllRecords")]
        //public async Task<string> GetAllRecords(string type, string size, string date)
        //{
        //    return await _iRepository.GetAllRecords(type, size, date);
        //}
    }
}
